package be.idamf.cortizone.fileprocessor
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.filesystem.File;
	
	[DefaultProperty("processors")]
	
	public class FileProcessors implements IFileProcessor
	{
		[ArrayElementType("be.idamf.cortizone.fileprocessor.IFileProcessor")]
		[Bindable]
		public var processors:Array;
		
		private var processor:IFileProcessor;
		
		public function FileProcessors()
		{
			super();
		}
		
		public function reset():void
		{
			for each (processor in processors)
				processor.reset();
		}
		
		public function cancel():void
		{
			for each (processor in processors)
				processor.cancel();
		}
		
		public function process(file:File):Boolean
		{
			for each (processor in processors)
				if (!processor.process(file))
					return false;
			
			return true;
		}
	}
}